package com.lagou.sqlSession;

public enum SqlCommandType {
    UNKNOWN("unknown"),
    INSERT("insert"),
    UPDATE("update"),
    DELETE("delete"),
    SELECT("select");

    private String value;

    private SqlCommandType(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static SqlCommandType getType(String valueStr) {
        for (SqlCommandType enums : SqlCommandType.values()) {
            if (enums.value.equals(valueStr.toLowerCase())) {
                return enums;
            }
        }
        return UNKNOWN;
    }
}
